<HTML><HEAD><TITLE>kill_suspension(?Susp)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Advanced Control and Suspensions</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>kill_suspension(?Susp)</H1>
Kill the suspended goal represented by Susp, i.e. treat it as if it had
been woken.


<DL>
<DT><EM>Susp</EM></DT>
<DD>A suspension or variable.
</DD>
</DL>
<H2>Description</H2>
   The suspended goal represented by Susp is killed, and the suspension is
   marked as now representing a woken goal.  If the suspension was already
   marked as woken, kill_suspension/1 just succeeds. If called with a
   variable, it succeeds as well which is useful when writing demon
   predicates that might not have a suspension the first time they are
   invoked.

<P>
   Note that a suspension is not a standard Prolog data structure and can
   only be manipulated in a restricted way.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>kill_suspension(?) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Susp is not a suspension.
</DL>
<H2>Examples</H2>
<PRE>
[eclipse 1]: suspend(writeln(hello), 3, X-&gt;inst, Susp),
	X=1.	% wakes
hello

Susp = 'SUSP-_299-dead'
X = 1
Yes (0.00s cpu)


[eclipse 2]: suspend(writeln(hello), 3, X-&gt;inst, Susp),
        kill_suspension(Susp),
	X=1.	% no effect

Susp = 'SUSP-_308-dead'
X = 1
Yes (0.00s cpu)
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/compiler/demon-1.html">demon / 1</A>, <A HREF="../../kernel/suspensions/make_suspension-3.html">make_suspension / 3</A>, <A HREF="../../kernel/suspensions/get_suspension_data-3.html">get_suspension_data / 3</A>, <A HREF="../../kernel/suspensions/attach_suspensions-2.html">attach_suspensions / 2</A>, <A HREF="../../kernel/suspensions/insert_suspension-3.html">insert_suspension / 3</A>, <A HREF="../../kernel/suspensions/insert_suspension-4.html">insert_suspension / 4</A>
</BODY></HTML>
